import argparse
import json
from Fuzzer import BaseFuzzer

def main():
    # 创建参数解析器
    parser = argparse.ArgumentParser(description='Run the fuzzer with specified configuration')
    parser.add_argument('config', nargs='?', default='./configs/openssl.json', 
                       help='Path to the configuration JSON file (default: ./configs/openssl.json)')
    
    # 解析参数
    args = parser.parse_args()


    # 初始化fuzzer
    fuzzer = BaseFuzzer(args.config)
    # fuzzer = BaseFuzzer('./configs/openssl_with_master.json')
    # 执行fuzzing流程
    # fuzzer.perform_dry_run()
    fuzzer.fuzz()
    fuzzer.clear()
    
    print("Fuzzing completed successfully.")



# python3 main.py ./configs/openssl.json
if __name__ == "__main__":
    main()


    